package org.lcc.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("user")
public class User {

    @TableId(type = IdType.AUTO) // 主键，自增
    private Integer userId;

    @TableField("username")
    private String username;

    @TableField("password")
    private String password;

    @TableField("role")
    private Role role;

    @TableField("email")
    private String email;

    @TableField("real_name")
    private String realName;


    @TableField("school_number")
    private String schoolNumber;

    @TableField(value = "create_time", fill = FieldFill.INSERT) // 自动填充字段
    private LocalDateTime createTime;

    // 枚举类型
    public enum Role {
        student, teacher
    }
}